let ZRG1: string = "我是一个好学生";
ZRG1 = "666";
const ZRG2: string = "我是一个好学生";
ZRG2 = "anabab";

let ZRG3: boolean = false;
let ZRG4: number = 54122;
let ZRG5: string = "fdsfdsffsd";
let list1: number[] = [1, 2, 3, 4];
let list2: Array<number> = [1, 2, 3];
const zrg1: object = { "sadasd": 45654 };
const wxx: object = { "dsds": 78, "ghg": 56, "sdsd": 123 };

function add(x: number, y: number): number {
	return x + y;
}
add(sd);

function zrg2(x: string, y?: string): string {
	return x + y;
}

function sdf(a: string, ...b: string[]): string {

	if (b)
		return b + a;
	else
		return a + b;
}

function buildName(firstName: string, lastName = "Smith") {
	return firstName + " " + lastName;
}
buildName('xyz');
buildName('xyz', 'zxy');
buildName('xyz', 'zxy', 'xzy');

function app(x: string | number, y: string | number) {
	if (typeof x === "number" && typeof y === "number") {
		return x + y;
	} else if (typeof x === "string" && typeof y === "string") {
		return x + y;
	} else {
		return x.toString() + y.toString();
	}
}
